package com.jackeys.piaems.controller;

import com.jackeys.piaems.annotation.PassJwt;
import com.jackeys.piaems.service.CategoryService;
import com.jackeys.piaems.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: CategoryController
 * @Description: 类别控制器
 * @Author: Jackeys
 * @Date: 2021-06-25 11:24
 * @Version: 1.0
 */
@CrossOrigin
@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
    * @Name: getAllCategories
    * @Description: 处理获取类别请求
    * @Param: []
    * @return: com.jackeys.piaems.vo.ResponseVo
    * @Author: Jackeys
    * @Date: 2021/6/25 11:26
    * @Version: 1.0
    */
    @PassJwt
    @RequestMapping("/category/getAllCategories")
    public ResponseVo getAllCategories(){
        return categoryService.getAllCategories();
    }
}
